# example plugin - also proof of concept to show that external plugins override
# builtins. here, title and time are enclosed in ">> ... <<"
# if you rename this to "audacious.mpip" it will override the builtin and you
# can see the difference.
function audacious_fillarray {
if [[ "$1" != "dryrun" ]]; then
# get the info
i=0
while read info[${player}$i]; do
((i++))
done < <(audtool current-song-tuple-data artist current-song-tuple-data title current-song-filename current-song-output-length current-song-length playback-status)
for (( ; i < 6 ; i++ )); do
info[${player}$i]=''
done
title_concat
case "${info[${player}5]}" in
playing)
info[${player}0]="${state_nice[0]}" # Playing
[[ "$icondir" != "" ]] && info[${player}8]="${icons[0]}" # icons use different names
;;
paused)
info[${player}0]="${state_nice[1]}" # Paused
[[ "$icondir" != "" ]] && info[${player}8]="${icons[1]}" # icons use different names
;;
stopped)
info[${player}0]="${state_nice[2]}" # Stopped
[[ "$icondir" != "" ]] && info[${player}8]="${icons[2]}" # icons use different names
[[ "${info[${player}1]}" == "" ]] && info[${player}1]="$player: ${state_nice[2]}"
;;
*)
info[${player}0]="${state_nice[3]}" # State_Unknown
;;
esac
filename_as_title
time_concat
fi
info[${player}4]="audacious -t"
info[${player}5]="audacious -f"
info[${player}6]="audacious -r"
info[${player}7]="audacious -m"
info[1]=">> ${info[${player}1]} <<" # just messing around (see explanation)
info[3]=">> ${info[${player}3]} <<"
}
